<!DOCTYPE html>
<html class="x-admin-sm">
    {include file="Admin/Public/head" title="系统设置" /}
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">
                    {volist name="data" id="val"}
                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label">
                            {$val['descs']}
                        </label>
                        <div class="layui-input-inline">
                            {if $val['id'] == 2 || $val['id'] == 3}
                                <input type="radio" name="data[{$val['id']}][vals]" value="是" title="是" {if $val['vals'] == '是'}checked{/if} >
                                <input type="radio" name="data[{$val['id']}][vals]" value="否" title="否" {if $val['vals'] == '否'}checked{/if} >
                            {elseif $val['id'] == 4 /}
                                <select name="data[{$val['id']}][vals]">
                                    <option value="Inception" {if $val['vals'] == 'Inception'}selected{/if}>Inception</option>
                                    <option value="Theme1" {if $val['vals'] == 'Theme1'}selected{/if}>Theme1</option>
                                </select>
                            {else/}
                                <input type="text" name="data[{$val['id']}][vals]" value="{$val['vals']}" autocomplete="off" class="layui-input">
                            {/if}
                        </div>
                    </div>
                    {/volist}
                    <div class="layui-form-item">
                        <label for="L_repass" class="layui-form-label">
                        </label>
                        <button  class="layui-btn" lay-filter="add" lay-submit="">
                            增加
                        </button>
                    </div>
              </form>
            </div>
        </div>
        <script>layui.use(['form', 'layer', 'laydate'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                laydate = layui.laydate,
                layer = layui.layer;
                laydate.render({
                    elem: '#expire',
                    type: 'date',
                    trigger : 'click',
                });
                //监听提交
                form.on('submit(add)', function(data) {
                    layer.load(2);
                    $.post("/admin/setting/create", data.field, function(data){
                        layer.closeAll();
                        if (data.code == 200) {
                            layer.msg(data.msg, {time: 1500}, function(){
                                location.reload();
                            })
                        } else if (data.code) {
                            layer.msg(data.msg)
                        }
                    })
                    return false;
                });

            });</script>
        <script>var _hmt = _hmt || []; (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();</script>
    </body>

</html>
